<template>
    <!-- 产品详情-box -->
    <view class="good-info-box">
        <view class="g-i-a">
            <!-- 手机号码 -->
            <view>
                <text class="a-title">{{ phoneLbTxt }}</text>
                <text>{{ cellphone ? " " + cellphone : " 暂无手机号" }}</text>
            </view>
            <!-- 国家 -->
            <view>
                <text class="a-title">国家:</text>
                <text>{{ " " }}{{ country == 1 ? "中国" : "国外" }}</text>
            </view>
            <!-- 供应商地址 -->
            <view>
                <text class="a-title">{{ adrrLbtxt }}</text>
                <text
                    >{{ " "
                    }}{{
                        district || address ? district + address : "暂无地址"
                    }}</text
                >
            </view>
            <!-- 累计销售 -->
            <view>
                <text class="a-title">累计供货:</text>
                <text class="c-s-m icon-font icon-style" @click="onClick"
                    >{{ amount ? " " + amount + " " : " 0 " }}&#xe600;</text
                >
            </view>
        </view>
        <view class="g-i-a">
            <!-- <view>
                <text class="a-title">{{ dDocumentDebtTxt }}</text>
                <text class="price">{{ rece ? " " + rece : " 0" }}</text>
            </view> -->
            <!-- 我的余额 -->
            <view>
                <text class="a-title">{{ balanceTxt }}</text>
                <text
                    class="price price-link icon-font icon-style"
                    @click="onClickPrice"
                    >{{ money ? " " + money + " " : " 0 " }} &#xe600;</text
                >
            </view>

            <!-- 单据欠款： -->
            <view>
                <text class="a-title">{{ dDocumentDebtTxt }}</text>
                <text
                    class="price price-link icon-font icon-style"
                    @click="onReceMoney"
                    >{{
                        price_count ? " " + price_count + " " : " 0 "
                    }}&#xe600;</text
                >
            </view>
        </view>
    </view>
</template>

<script>
import lang from "../../js/conf/Lang.js";
export default {
    props: [
        "cellphone",
        "district",
        "country",
        "address",
        "amount",
        "rece",
        "price_count",
        "money",
    ],
    data() {
        return {
            phoneLbTxt: lang.supplierTxt.phoneLbTxt,
            adrrLbtxt: lang.supplierTxt.adrrLbtxt,
            countSaleLbTxt: lang.supplierTxt.countSaleLbTxt,
            dDocumentDebtTxt: lang.supplierTxt.dDocumentDebtTxt,
            balanceTxt: lang.supplierTxt.balanceTxt,
            ddysLbtxt: lang.supplierTxt.ddysLbtxt,
        };
    },

    methods: {
        onClick() {
            this.$emit("countSaleMoney");
        },

        onClickPrice() {
            this.$emit("payMoneyRece");
        },

        onReceMoney() {
            this.$emit("receMoney");
        },
    },
};
</script>

<style lang="scss" scoped>
// 产品详情-box
.good-info-box {
    padding-left: 20px;
    .g-i-a {
        border-bottom: 1px solid #eee;
        padding: 10px 0;
        color: #333;
        font-size: 14px;
        .a-title {
            // color: #9FA0A8;
            color: #999;
            display: inline-block;
            width: 80px;
            text-align-last: justify;
            text-align: justify;
            text-justify: distribute-all-lines;
        }
        .price {
            color: #f04848;
        }

        .price-link {
            cursor: pointer;
        }
        .price-link:hover {
            color: #ff0000;
        }
        .c-s-m {
            cursor: pointer;
        }

        .c-s-m:hover {
            color: #3388ff;
        }
    }
}
</style>
